<template>
  <div style="padding: 10px; margin-bottom: 60px;">
    <div style="position: fixed; top:10px; left:10px;z-index: 99; width:200px; background-color: white">
      <el-radio-group v-model="logType" size="small" @change="readWriteLog()">
        <el-radio-button label="1">读日志</el-radio-button>
        <el-radio-button label="2">写日志</el-radio-button>
      </el-radio-group>
    </div>
    <log-reader @gotoWrite="gotoWrite" ref="reader" v-show="logType==1"></log-reader>
    <log-writer @gotoRead="gotoRead" ref="writer" v-show="logType==2"></log-writer>
  </div>
</template>

<script>
  import LogWriter from '@/components/ding/log-writer'
  import LogReader from '@/components/ding/log-reader'

  export default {
    data () {
      return {
        logType: 1
      }
    },
    components:{
      LogWriter,LogReader
    },
    mixins: [],
    activated () {

    },
    created(){

    },
    methods: {
      gotoWrite(){
        this.logType =2
        this.$nextTick(()=>{
          this.$refs.writer.load();
        })
      },
      gotoRead(){
        this.logType =1
        this.$nextTick(()=>{
          this.$refs.reader.loadLog();
        })
      },
      readWriteLog(){
        /*
        if(this.logType==1){
          this.$nextTick(()=>{
            this.$refs.reader.loadLog();
          })
        }
        if(this.logType==2){
          this.$nextTick(()=>{
            this.$refs.writer.load();
          })
        }*/
      },
    }
  }
</script>
<style lang="scss" scoped>


</style>
/*
// 获取数据列表
     listMyUnDoneProject(){
this.$http({
url: this.$http.adornUrl('/wpb/projectbase/list'),
method: 'post',
data: this.$http.adornData({
'page': 1,
'limit': 20,
'memberId': this.userInfo.dingId,
'flag': 1
})
}).then(({data}) => {
if (data && data.code === 0) {
this.unDoneProjs = data.page.list;
} else {
}
}
).catch(error=>{
console.info(error)
})
},*/
